import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/sys/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/sys/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout(token) {
  return request({
    url: '/sys/user/logout',
    method: 'post',
    params: { token }
  })
}

export function getusers(token) {
  return request({
    url: '/sys/user/',
    method: 'post',
    params: { token }
  })
}
export function getuserbyemp(empno) {
  return request({
    url: '/user/getUserList',
    method: 'get',
    params: { empNo: empno }
  })
}

export function getuserlist(query) {
  return request({
    url: '/user/getUserList',
    method: 'get',
    params: query
  })
}
export function getuserlistbyRole(query) {
  return request({
    url: '/user/getUserListByRoleId',
    method: 'get',
    params: query
  })
}
